1 module hip.api.renderer.operations;
2 
3 
4 /// Those are fairly known functions in the graphics programming world
5 enum HipBlendFunction
6 {
7     ZERO,
8     ONE,
9     SRC_COLOR,
10     ONE_MINUS_SRC_COLOR,
11     DST_COLOR,
12     ONE_MINUS_DST_COLOR,
13     SRC_ALPHA,
14     ONE_MINUS_SRC_ALPHA,
15     DST_ALPHA,
16     ONE_MINUS_DST_ALPHA,
17     CONSTANT_COLOR,
18     ONE_MINUS_CONSTANT_COLOR,
19     CONSTANT_ALPHA,
20     ONE_MINUS_CONSTANT_ALPHA,
21 }
22 
23 /** 
24  * The equation is made by:
25  * HipBlendEquation(HipBlendFunction, HipBlendFunction)
26  */
27 enum HipBlendEquation
28 {
29     DISABLED,
30     ADD,
31     SUBTRACT,
32     REVERSE_SUBTRACT,
33     MIN,
34     MAX
35 }
36 
37 ///Which function should be employed whene testing the Depth/Z-Buffer
38 enum HipDepthTestingFunction
39 {
40     ///Means that nothing will be drawed
41     Never,
42     ///Same as no depth test
43     Always,
44     ///Render if the value is less than the current depth
45     Less,
46     ///Render if the value is less or equal than the current depth
47     LessEqual,
48     ///Render if the value is greater than the current depth
49     Greater,
50     ///Render if the value is greater or equal than the current depth
51     GreaterEqual,
52     ///Render if the value is equal against the current depth
53     Equal,
54     ///Render if the value is not equal against the current depth
55     NotEqual,
56 }
57 
58 enum HipStencilOperation
59 {
60     ///	The currently stored stencil value is kept.
61     Keep,
62     ///	The stencil value is set to 0.
63     Zero,
64     /// The stencil value is replaced with the reference value set with glStencilFunc.
65     Replace,
66     /// The stencil value is increased by 1 if it is lower than the maximum value.
67     Increment,
68     /// Same as Increment but wraps it back to 0 as soon as the maximum value is exceeded.
69     IncrementWrap,
70     /// The stencil value is decreased by 1 if it is higher than the minimum value.
71     Decrement,
72     /// Same as Decrement but wraps it to the maximum value if it ends up lower than 0.
73     DecrementWrap,
74     /// Bitwise inverts the current stencil buffer value.
75     Invert,
76 }
77 
78 ///Simply an alias to the depth testing function.
79 alias HipStencilTestingFunction = HipDepthTestingFunction;